<style>
#lokacijeAdminForm{
	width:600px;
}
#lokacijeAdminForm label{
	display:block;
	float:left;
	padding-top:8px;
	text-align:right;
}
#lokacijeAdminForm table{
	width:100%;
	margin-top:10px;
}
#lokacijeAdminForm table tr.head{
	text-align:center;
	cursor:default;
}
#lokacijeAdminForm table tr{
	cursor:pointer;
}
#lokacijeAdminForm table tr:hover{
	background:{{$highlight}};
	color:{{$highlighttext}};
}
.info{
	font-size:10px;
	color:#aaa;
	margin-left:5px;
}
#editContainer{
	width:300px;
}
#editContainer label{
	display:block;
	float:left;
	padding-top:8px;
	clear:both;
	width:70px;
	text-align:right;
}
#editContainer input[type=submit]{
	float:right;
	background-image:url(gui/icons/save.gif);
	background-repeat:no-repeat;
	background-position:3px center;
	padding-left:18px;
}
#newLokTemplate{
	width:250px;
	display:none;
	margin-left:2px;
}
#newLokTemplate input[type=submit]{
	float:right;
	clear:both;
}
#newLokTemplate label{
	width:60px;
}
</style>
<form class="area" action="javascript:void(0)" onsubmit="submitForm(this,'geos.php','POST','setContent',1)" id="lokacijeAdminForm">
	<input type="hidden" name="a" value="lokacije" />
	<input type="hidden" name="page" value="{{$pageID}}" />

	<div class="info" style="float:right">{{$info}}</div><br clear="all" />
	{{$comment_admin_start}}
	<input type="button" style="float:right;" class="novi" value="nova" onclick="novaLokacija(this)" />
	{{$comment_admin_end}}
	<h1>Lokacije</h1>
	<fieldset>
		<legend>Filter:</legend>
		
		<label for="filter_name">Naziv:</label><input type="text" name="filter_name" id="filter_name" value="{{$filter_name}}" />
		
		<label for="filter_tip">Tip:</label>
		<select name="filter_tip" id="filter_tip" onchange="updateFilterLokacijeParent(this)">
			<option value="-1">---</option>
			{{%loop start tipid}}
			<option value="{{$tipid}}" {{$selected_tip}}>{{$tipname}}</option>
			{{%loop end}}
		</select>
		
		<span style="{{$fpg_display}}" id="filterParentGrad">
		<label for="filter_parent_grad">Opština:</label>
		<select name="filter_parent_grad" id="filter_parent_grad">
			<option value="-1">---</option>
			{{%loop start fpg_id}}
			<option value="{{$fpg_id}}" {{$fpg_selected}}>{{$fpg_name}}</option>
			{{%loop end}}
		</select>
		</span>
		<span style="{{$fplo_display}}" id="filterParentLokOpstina">
		<label for="filter_parent_lokopstina">Mesto:</label>
		<select name="filter_parent_lokopstina" id="filter_parent_lokopstina">
			<option value="-1">---</option>
			{{%loop start fplo_id}}
			<option value="{{$fplo_id}}" {{$fplo_selected}}>{{$fplo_name}}</option>
			{{%loop end}}
		</select>
		</span>
		<span style="{{$fpn_display}}" id="filterParentNaselje">
		<label for="filter_parent_naselje">Lok.opština:</label>
		<select name="filter_parent_naselje" id="filter_parent_naselje">
			<option value="-1">---</option>
			{{%loop start fpn_id}}
			<option value="{{$fpn_id}}" {{$fpn_selected}}>{{$fpn_name}}</option>
			{{%loop end}}
		</select>
		</span>
		
		<input type="submit" name="submit" id="submit" value="filter" />
	</fieldset>
	{{$comment_start}}
	<ul class="letter_filter">
		<li>Strana:</li>
		{{%loop start page}}
		<li><a id="{{$current_page}}" href="javascript:void(0)" onclick="filterAdminLokacije(this)">{{$page}}</a></li>
		{{%loop end}}
	</ul><br clear="all" />
	<table>
		<tr class="head">
			<td width="5%">šifra</td>
			<td width="13%">tip</td>
			<td width="11%">PTT</td>
			<td width="30%">naziv</td>
			<td>roditelj</td>
		</tr>
		{{%loop start lid}}
		<tr title="Izmeni..." onclick="editLokacija({{$lid}},'{{$lok_ptt}}','{{$lok_naziv}}','{{$lok_tip_id}}','{{$lok_parent_id}}')">
			<td>{{$lid}}</td>
			<td>{{$lok_tip}}</td>
			<td align="right">{{$lok_ptt}}</td>
			<td>{{$lok_naziv}}</td>
			<td>{{$lok_parent}}</td>
		</tr>
		{{%loop end}}
	</table>
	{{$comment_end}}
</form>
<form id="newLokTemplate" class="area" action="javascript:void(0)" onsubmit="submitForm(this,'geos.php','POST','afterNovaLokacija',1)">
	<h2>Nova lokacija</h2>
	<input type="hidden" name="a" value="lokacije" />
	<input type="hidden" name="mod" value="saveNew" />
	
	<label class="left" for="new_lok_ptt">PTT:</label><input type="text" name="new_lok_ptt" id="new_lok_ptt" /><br clear="all" />
	<label class="left" for="new_lok_name">naziv:</label><input type="text" name="new_lok_name" id="new_lok_name" /><br clear="all" />
	<label class="left" for="new_lok_tip">tip:</label>
	<select name="new_lok_tip" id="new_lok_tip" onchange="onchangeNewTip(this);">
		<option value="-1">---</option>
		{{%loop start tipid}}
		<option value="{{$tipid}}" {{$selected_tip}}>{{$tipname}}</option>
		{{%loop end}}
	</select>
	<input type="hidden" name="new_parent" id="new_parent" value="" />
	<br clear="all" />
	<div id="n_parent_grad" style="display:none">
		<label class="left" for="new_parent_grad">opština:</label>
		<select name="new_parent_grad" id="new_parent_grad" onchange="document.getElementById('new_parent').value=this.value">
			{{%loop start fpg_id}}
			<option value="{{$fpg_id}}" {{$fpg_selected}}>{{$fpg_name}}</option>
			{{%loop end}}
		</select>
	</div>
	<div id="n_parent_lops" style="display:none">
		<label class="left" for="new_parent_lops">grad:</label>
		<select name="new_parent_lops" id="new_parent_lops" onchange="document.getElementById('new_parent').value=this.value">
			{{%loop start fplo_id}}
			<option value="{{$fplo_id}}" {{$fplo_selected}}>{{$fplo_name}}</option>
			{{%loop end}}
		</select>
	</div>
	<div id="n_parent_nas" style="display:none">
		<label class="left" for="new_parent_nas">lok.opština:</label>
		<select name="new_parent_nas" id="new_parent_nas" onchange="document.getElementById('new_parent').value=this.value">
			{{%loop start fpn_id}}
			<option value="{{$fpn_id}}" {{$fpn_selected}}>{{$fpn_name}}</option>
			{{%loop end}}
		</select>
	</div>
	<input type="submit" class="save" value="sačuvaj" />
</form>